#include "lorismessenger.h"
#include <QDebug>
#include <QTextCodec>

LorisMessenger::LorisMessenger(QObject *parent) :
    QIODevice(parent)
{
    mp_codec = QTextCodec::codecForLocale();
}


qint64 LorisMessenger::readData(char */*data*/, qint64 /*maxlen*/)
{
    return 0;
}

qint64 LorisMessenger::writeData(const char *data, qint64 len)
{
    QString qstr_msg = mp_codec->toUnicode(data);
    emit message_string(qstr_msg);
    return len;
}

bool LorisMessenger::isReadable()
{
    return false;
}
